home *** CD-ROM | disk | FTP | other *** search
- /* ===============
- * PedMenuApple.cc
- * ===============
- */
-
- #include "PedestalDebugging.h"
-
- #include <Devices.h>
-
- #include "PedMenuApple.hh"
- #include "PedCommand.hh"
-
- enum {
- idAppleMENU = 128, // menu ID = 1
- idFileMENU,
- idEditMENU
- };
-
-
- PedMenuApple::PedMenuApple()
- : mAboutCmd(NULL)
- {
- GetFromResource(idAppleMENU);
- AppendAppleMenuItems();
- }
-
- void
- PedMenuApple::AppendAppleMenuItems()
- {
- ::AppendResMenu(macMenu, 'DRVR');
- }
-
- void
- PedMenuApple::InstallCommand(PedCommand *inCmd, CmdCode inCode)
- {
- switch (inCode) {
- case 'abou':
- mAboutCmd = inCmd;
- break;
- default:
- break;
- }
- }
-
- void
- PedMenuApple::DoMenuItem(short inItem)
- {
- PedCommand *cmd;
-
- switch (inItem) {
- case 1:
- cmd = mAboutCmd;
- break;
- default:
- cmd = NULL;
- DoAppleMenuItem(inItem);
- break;
- }
- if (cmd)
- cmd->Execute();
- }
-
- void
- PedMenuApple::DoAppleMenuItem(short inItem)
- {
- GrafPtr savePort;
- Str255 itemName;
-
- GetItemText(inItem, itemName);
- ::GetPort(&savePort);
- ::OpenDeskAcc(itemName);
- ::SetPort(savePort);
- }
-